// 查找数组中元素出现次数大于输入n的元素
Array.prototype.getNum = function(n) {
  if (n > this.length) {
    return -1;
  }
  const res = [];
  const map = new Map();
  for (const item of this) {
    if (map[item]) {
      map[item]++;
    } else {
      map[item] = 1;
    }
  }
  console.log(map);
  for (let num in map) {
    if (map[num] > n) {
      res.push(parseInt(num));
    }
  }
  return res;
}

const arr = [1, 2, 3, 3, 3, 3, 4, 5, 5, 5, 2]
console.log(arr.getNum(1));